package pro.cherish.knowledgeumldesignpattern.designPattern.com.cherish.factory.simplefactory;

import pro.cherish.knowledgeumldesignpattern.designPattern.com.cherish.factory.Audi;
import pro.cherish.knowledgeumldesignpattern.designPattern.com.cherish.factory.Byd;
import pro.cherish.knowledgeumldesignpattern.designPattern.com.cherish.factory.Car;

public class CarFactory {
    public static Car create(String typeStr){
        if("奥迪".equals(typeStr)){
            return new Audi();
        }else if("比亚迪".equals(typeStr)){
            return new Byd();
        }else{
            return null;
        }
    }
}
